package com.beetobe.xmpp;

import java.io.IOException;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.google.appengine.api.xmpp.Subscription;
import com.google.appengine.api.xmpp.XMPPService;
import com.google.appengine.api.xmpp.XMPPServiceFactory;

@SuppressWarnings("serial")
public class UnSubscriptionServlet extends HttpServlet {
	XMPPService xmppService = XMPPServiceFactory.getXMPPService();

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws IOException {
		doPost(request, response);
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws IOException {
		
		Subscription subscription = xmppService.parseSubscription(request);
		String from = subscription.getFromJid().getId();
		String to = subscription.getToJid().getId();

		System.out.println("From : " + from);
		System.out.println("To : " + to);
	}
}
